package com.example.poverty.service.impl;

import com.example.poverty.dao.WorklogMapper;
import com.example.poverty.entity.Worklog;
import com.example.poverty.service.WorklogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端 工作日志service 实现类
 */
@Service
public class WorklogServiceImpl implements WorklogService {

    @Autowired
    private WorklogMapper worklogMapper;

    @Override
    public boolean insert(Worklog worklog) {
        return worklogMapper.insert(worklog) > 0;
    }

    @Override
    public boolean update(Worklog worklog) {
        return worklogMapper.update(worklog) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return worklogMapper.delete(id) > 0;
    }

    @Override
    public Worklog selectByPrimaryKey(Integer id) {
        return worklogMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Worklog> allWorklog() {
        return worklogMapper.allWorklog();
    }

    @Override
    public Worklog getByName(String name) {
        return worklogMapper.getByName(name);
    }
}
